package cn.findviewbydream.evil.app.dto

import cn.findviewbydream.evil.main.entity.BaseSeatEntity
import cn.findviewbydream.evil.main.entity.EmployeeEntity
import cn.findviewbydream.evil.main.entity.MealEntity
import java.io.Serializable
import java.util.*

/********************************************
 * 工程名：MealOrder
 * 包名：cn.findviewbydream.evil.app.dto
 * 时间：17-1-26
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：
 ********************************************/
class CompleteMealBean : Serializable
{
    var orderId = 0/*订单id*/
    var seatId: BaseSeatEntity? = null/*座位号*/
    var waiter: EmployeeEntity? = null/*负责该订单的服务员*/
    var createDateTime: Date? = null/*创建时间*/

    var orderItemId = 0/*订单项目id*/
    var mealId: MealEntity? = null/*菜品id*/
    var mealNum = 0/*菜品数量*/

    constructor()
    constructor(orderId: Int, seatId: BaseSeatEntity?, waiter: EmployeeEntity?, createDateTime: Date?, orderItemId: Int,
                mealId: MealEntity?, mealNum: Int)
    {
        this.orderId = orderId
        this.seatId = seatId
        this.waiter = waiter
        this.createDateTime = createDateTime
        this.orderItemId = orderItemId
        this.mealId = mealId
        this.mealNum = mealNum
    }


    override fun equals(other: Any?): Boolean
    {
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as CompleteMealBean

        if (orderId != other.orderId) return false
        if (orderItemId != other.orderItemId) return false

        return true
    }

    override fun hashCode(): Int
    {
        var result = orderId
        result = 31 * result + orderItemId
        return result
    }

    override fun toString(): String
    {
        return "CompleteMealBean(orderId=$orderId, seatId=$seatId, waiter=$waiter, createDateTime=$createDateTime, orderItemId=$orderItemId, mealId=$mealId, mealNum=$mealNum)"
    }

}